package com.ftg.learn.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author kangjx
 * @since 2023-09-20
 */
@ApiModel(value = "User对象", description = "用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * AUTO 表示自动处理 mysql increment
     * mysql
     * sqlserver
     * oracle没有自增
     * ASSIGN_ID 用户指定
     */
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "编号表外键",example = "001")
    @TableField(value = "userno_id")
    private Integer usernoId;

    //表示mybatis plus 表字段声明
    @ApiModelProperty(value = "登陆帐号",example = "admin")
    @TableField(value = "username",exist = false)
    private String username;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("真实姓名")
    private String realname;

    @ApiModelProperty("用户性别,0 1 2 ")
    private Byte gender;


    @TableLogic(value = "3",delval = "8")
    private byte ist; // 3 8

    //select * from user where ist = 3;

    //delete from user where id = 45;
    // update user set ist = 8 where id = 45;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUsernoId() {
        return usernoId;
    }

    public void setUsernoId(Integer usernoId) {
        this.usernoId = usernoId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public Byte getGender() {
        return gender;
    }

    public void setGender(Byte gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "User{" +
            "id = " + id +
            ", usernoId = " + usernoId +
            ", username = " + username +
            ", password = " + password +
            ", realname = " + realname +
            ", gender = " + gender +
        "}";
    }
}
